 <!DOCTYPE HTML>
<html>
  <head>
  <meta charset="UTF-8">
  <title>提交订单_
  好吃佳  _城语订餐</title>
  <meta name="generator" content="editplus">
  <meta name="author" content="">
  <meta name="keywords" content="昆明在线点菜订餐,昆明餐厅查询预订,昆明团购优惠,昆明美食餐饮">
  <meta name="description" content="最便捷的互联网订餐平台，专业的在线订餐服务提供商。为广大消费者提供免费的在线查询餐厅情况、预订座位、选菜点菜以及折扣优惠等内容服务。">
  <meta id="viewport" name="viewport" content = "width=device-width,  initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <meta name="apple-itunes-app" content="app-id=425349261"/>
  <meta name="apple-mobile-web-app-capable" content="yes">

  <link href="/css/style.css" rel="stylesheet" type="text/css" />
  <script language="javascript">
		/*** 增加菜品数量 ****/
		function add(dishNum){
			var a = document.getElementById("dishOK_" + dishNum);
			var b = document.getElementById("dishPrice_" + dishNum);
			var num = parseFloat(a.value);
			var price = parseFloat(b.innerHTML);
			var unitPrice = price/num;
			num++ ;
			price = unitPrice * num;
			a.value = num;
			b.innerHTML = price;
			sum();
		}
		/*** 减少菜品数量删除菜品 ****/
		function subtraction(dishNum){
			var a = document.getElementById("dishOK_" + dishNum);
			var b = document.getElementById("dishPrice_" + dishNum);
			var num = parseFloat(a.value);
			var price = parseFloat(b.innerHTML);
			var unitPrice = price/num;
			if ( num > 1 )
			{
				num--;
				price = unitPrice * num;
			}
			else if ( num == 1 )
			{
				myOrderList.removeChild(a.parentNode.parentNode);
				listInitialNum --;
			}
			a.value = num;
			b.innerHTML = price;
			sum();
		}
		/*** 计算菜品合计价格和数量 ****/
		function sum(){
			var sumPrice = document.getElementById("sumPrice");
			var sumDishes = document.getElementById("sumDishes")
			var sumNum = 0 ;
			var sumDishesNum = 0 ;
			//alert(listInitialNum);
			for( i = 0 ; i < listInitialNum - 1 ; i++ ){//有一个li用于存放菜品合计价格和数量
					var price = myOrderList.getElementsByTagName("li")[i].getElementsByTagName("span")[1].getElementsByTagName("label")[0];
					var thisDishNum = myOrderList.getElementsByTagName("li")[i].getElementsByTagName("span")[2].getElementsByTagName("input")[1];
					sumNum = sumNum + parseFloat(price.innerHTML);
					sumDishesNum = sumDishesNum + parseFloat(thisDishNum.value);
			}
			sumPrice.innerHTML = sumNum ;
			sumDishes.innerHTML = sumDishesNum ;
			sumArray();
		}
		/*** 统计全部已点菜品 ****/
		function sumArray(){
			var sumPrice = document.getElementById("sumPrice");
			var sumDishes = document.getElementById("sumDishes")
			var sumNum = 0 ;
			var sumDishesNum = 0 ;
			var sumDishesArray = "";
			//alert(listInitialNum);
			for( i = 0 ; i < listInitialNum - 1 ; i++ ){//有一个li用于存放菜品合计价格和数量
					var id = myOrderList.getElementsByTagName("li")[i].getElementsByTagName("span")[1].getElementsByTagName("label")[0].id.split("_")[1];
					var price = myOrderList.getElementsByTagName("li")[i].getElementsByTagName("span")[1].getElementsByTagName("label")[0];
					var thisDishNum = myOrderList.getElementsByTagName("li")[i].getElementsByTagName("span")[2].getElementsByTagName("input")[1];
					sumNum = sumNum + parseFloat(price.innerHTML);
					sumDishesNum = sumDishesNum + parseFloat(thisDishNum.value);
					if ( i == listInitialNum - 2 )
					{
						sumDishesArray += id + "," + price.innerHTML + "," + thisDishNum.value ;
					}
					else{ sumDishesArray += id + "," + price.innerHTML + "," + thisDishNum.value + "|" ; }
			}
			document.getElementById("sumArrayArea").value = sumDishesArray;
		}
  </script>
  </head>
  <body>
<div id="container">
    <div id="header">
    <div id="left">
		<a href="javascript:" onClick="bc()"><img src="../images/transparent.png" class="return" /></a><h1>好吃佳</h1>
    </div>
    <div id="right"></div>
  </div>
    <form action="ExpressIndRestaurantProcessing.php?sid=3828" onSubmit="return subFm()" id="indRestaurantForm" method="post">
    <div id="content" >
        <h1>我的订单</h1>
    <ul class="myOrderList" id="myOrderList">
                <li> <span class="dish">
          小炒鸡盖饭          </span> <span class="price">￥
          <label id="dishPrice_203377">
            12          </label>
          </span> <span class="amount">
          <input type="button" value="+" onclick="add('203377');" class="add" id="addButton">
          <input type="text" name="dishOK_203377" id="dishOK_203377" class="num" value="1" disabled="disabled">
          <input type="button" value="-" onclick="subtraction('203377');" class="subtraction" id="subtractionButton">
          </span> </li>
                <li> <span class="dish">
          宫爆鸡丁盖饭          </span> <span class="price">￥
          <label id="dishPrice_203387">
            11          </label>
          </span> <span class="amount">
          <input type="button" value="+" onclick="add('203387');" class="add" id="addButton">
          <input type="text" name="dishOK_203387" id="dishOK_203387" class="num" value="1" disabled="disabled">
          <input type="button" value="-" onclick="subtraction('203387');" class="subtraction" id="subtractionButton">
          </span> </li>
                <li> <span class="dish">
          青椒炒蛋盖饭          </span> <span class="price">￥
          <label id="dishPrice_203396">
            11          </label>
          </span> <span class="amount">
          <input type="button" value="+" onclick="add('203396');" class="add" id="addButton">
          <input type="text" name="dishOK_203396" id="dishOK_203396" class="num" value="1" disabled="disabled">
          <input type="button" value="-" onclick="subtraction('203396');" class="subtraction" id="subtractionButton">
          </span> </li>
                <li> <span class="dish">
          小锅米线          </span> <span class="price">￥
          <label id="dishPrice_203407">
            8          </label>
          </span> <span class="amount">
          <input type="button" value="+" onclick="add('203407');" class="add" id="addButton">
          <input type="text" name="dishOK_203407" id="dishOK_203407" class="num" value="1" disabled="disabled">
          <input type="button" value="-" onclick="subtraction('203407');" class="subtraction" id="subtractionButton">
          </span> </li>
                <li class="sum"> 预计消费合计 <font color="red"><strong>￥
        <label id="sumPrice">0</label>
        </strong></font> 元 ( 共
        <label id="sumDishes">0</label>
        份 ) </li>
      </ul>
        <input type="text" name="sumArrayArea" id="sumArrayArea" style="display:none;">
    <script language="javascript">
				var myOrderList = document.getElementById("myOrderList");
				var listInitialNum = myOrderList.getElementsByTagName("li").length;
				sum();
		</script>
	<font color="red">免费送外卖，不收餐盒费。送餐范围：巫家坝、国贸中心、三十一中、民航路、官渡区人民医院、3公里以外3份起送。外送时间：10：30-20：30。</font>
    <ul class="myOrderInfo">
    
    <li> 就餐时间
    <select name="orderTime" id="orderTime"><option value="17:00" selected>17:00</option><option value="17:30">17:30</option><option value="18:00">18:00</option><option value="18:30">18:30</option><option value="19:00">19:00</option><option value="19:30">19:30</option><option value="20:00">20:00</option><option value="20:30">20:30</option><option value="21:00">21:00</option></select>        <!--
        <select name="orderTime" id="orderTime">
        <option value="11:30" selected>11:30</option>
        <option value="12:00">12:00</option>
        <option value="12:15">12:15</option>
        <option value="12:30">12:30</option>
        <option value="13:00">13:00</option>
        <option value="17:00">17:00</option>
        <option value="17:30">17:30</option>
        <option value="18:00">18:00</option>
        <option value="18:30">18:30</option>
        <option value="19:00">19:00</option>
        <option value="19:30">19:30</option>
        <option value="20:00">20:00</option>
        <option value="20:30">20:30</option>
        <option value="21:00">21:00</option>
      </select>-->
        （注：只支持当天订单） </li>
    <li> 您的姓名
        <!-- <input type="text" name="o_name" value="您怎么称呼" onclick="this.value='';" size="20" id="o_name" > -->
		<input type="text" name="o_name" value="" size="20" id="o_name" >
    </li>
    <li > 联系电话
		<input type="text" name="tel" value="null" size="20" id="tel" >
        <!-- <input type="text" name="tel" value="请输入您的手机号" onclick="this.value='';" size="20" id="tel" > -->
        &nbsp;
        <input type="text" name="name" value="随手点" onclick="this.value='';" size="20" style="display:none">
        <input type="radio" name="sex" class="radio" value="1" checked style="display:none">
        <input type="radio" name="sex" class="radio" value="0" style="display:none">
      </li>
    <li > 配送地址
    		<input type="text" name="address" value="" size="28" id="address" >
                <!-- <input type="text" name="address" value="请输入小区、单位名称与门牌号" onclick="this.value='';" size="28" id="address" > -->
        <select name="seatNum" id="seatNum" style="display:none;">
        select * from lexus_shop_admin_desk where ShopID=3828      </select>
      </li>
    <!--
			<li>
				<input type="text" name="" value="请输入今日点菜口令" onclick="this.value='';" size="20"> （您可以询问服务员）
			</li>
            -->
    <li >
        <label style="position:relative; top:-50px;">其他要求</label>
		<textarea name="remark" id="remark" rows="3" cols="30">		</textarea>
        <!-- <textarea name="remark" id="remark" rows="3" cols="30" onclick="this.value='';">还有其它要求吗？</textarea> -->
      </li>
    <li align="center">
        <input type="submit" class="submitOrder" value="提 交 下 单">
      </li>
    <ul>
    </div>
  </form>
    <div id="footer"> Copyright©2014 <a href="http://m.cyooy.com">城语订餐</a><br/>
    Cyooy.com 滇ICP备11001131号 </div>
  </div>
<script type="text/javascript">
function subFm(){
	var tel=document.getElementById("tel").value;
	var name=document.getElementById("o_name").value;
	var address=document.getElementById("address").value;
	if(name.length<1){
		alert("请填写您的姓名!");
		document.getElementById("o_name").focus();
		return false;
	}
	if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(tel))){
		alert("请填写正确的联系电话!");
		document.getElementById("tel").focus();
		return false;
	}
	if(address.length<1){
		alert("请填写您的送餐地址!");
		document.getElementById("address").focus();
		return false;
	}
}

function strtotime(strings)
{
    var _ = strings.split(' ');
    var ymd = _[0];
    var hms = _[1];
    var str = ymd.split('-');
    var fix = hms.split(':');
    var year  = str[0] - 0; 
    var month = str[1] - 0 - 1; 
    var day   = str[2] - 0; 
    var hour   = fix[0] - 0; 
    var minute = fix[1] - 0; 
    var second = fix[2] - 0;
    time = (new Date(year, month, day, hour, minute)).getTime();
    return parseInt( time / 1000 );
}
 /*** 弹窗 ***/
		function openWindow(content){
			var windowDiv = document.createElement("div");
			windowDiv.id = "windowDiv";
			windowDiv.name = "windowDiv";
			windowDiv.style.position = "absolute";
			windowDiv.style.zIndex = "1000";
			windowDiv.style.top = "20px";
			//windowDiv.style.top = document.body.scrollTop + 20 + "px";
			windowDiv.style.left = "10px";
			windowDiv.style.right = "10px";
			windowDiv.style.height = document.documentElement.clientHeight - 90 + "px";
			windowDiv.style.padding = "50px 5px 5px 5px";
			windowDiv.style.backgroundColor = "#EEE";
			windowDiv.style.border = "1px solid #AAA";
			windowDiv.style.overflowY = "auto";
			windowDiv.style.wordBreak = "break-all";
			document.body.appendChild(windowDiv);
			document.getElementById("container").style.display = "none" ;
			//window.scrollTo( document.body.scrollLeft , parseFloat(windowDiv.style.top.split("p")[0]) - 20 );
			var backButton = document.createElement("input");
			backButton.id = "backButton";
			backButton.type = "button";
			backButton.style.position = "absolute";
			backButton.style.top = "5px";
			backButton.style.left = "5px";
			backButton.style.width = "80px";
			backButton.style.height = "30px";
			//backButton.style.backgroundColor = "#E1E1E1";
			//backButton.style.border = "1px solid #AAA";
			backButton.style.lineHeight = "2.0em";
			backButton.align = "center";
			backButton.value = "<<返回     ";
			windowDiv.appendChild(backButton);
			var contentArea = document.createElement("div");
			contentArea.style.position = "absolute";
			contentArea.style.top = "45px";
			contentArea.style.left = "5px";
			contentArea.style.right = "5px";
			contentArea.style.height = document.documentElement.clientHeight - 100 + "px";
			contentArea.align = "center";
			contentArea.style.overflow = "auto";
			contentArea.innerHTML = content;
			//contentArea.style.border = "1px solid #333";
			windowDiv.appendChild(contentArea);
			document.getElementById("backButton").addEventListener("click",close,false);
			function close(){ document.body.removeChild(document.getElementById("windowDiv"));document.getElementById("container").style.display="inline"; 
							}
		}
			function bc(){
		var arr=document.getElementById("sumArrayArea").value.split('|');
		var par="";
		for(var i=0;i<arr.length;i++){
			par+=arr[i].split(',')[0]+",";
		}
		par=par.substring(0,par.lastIndexOf(','));
		window.location="ExpressMenu.php?id="+par+"&sid="+3828;
	}
	var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
	document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F281b41435e2add0e5f52e2be6c13921e' type='text/javascript'%3E%3C/script%3E"));
	  </script>
</body>
</html>